#ifndef SPECIALSSELECTMODEL_H
#define SPECIALSSELECTMODEL_H


#include <campaign.h>
#include <specialability.h>
#include <characterclass.h>
#include <classlevel.h>


#include <QAbstractListModel>
#include <QPointer>


class SpecialsSelectModel : public QAbstractListModel
{
    Q_OBJECT
public:

    explicit SpecialsSelectModel(QObject *parent = 0);

    void setCampaign(Campaign* campaign);

    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex &index, int role) const;

    virtual bool setData(const QModelIndex &index, const QVariant &value, int role);

    virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
    virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());

    virtual Qt::ItemFlags flags(const QModelIndex &index) const;

    void setCharacterClassLevel(const QString& name, int level);

    bool ready() const;


public slots:

    virtual void revert();


protected:

    QPointer<Campaign> m_campaign;
    QPointer<SpecialAbilities> m_specialAbilities;

    QPointer<CharacterClass> m_characterClass;
    QPointer<ClassLevel> m_classLevel;


};

#endif // SPECIALSSELECTMODEL_H
